package com.hp.team.bookstore.model.order;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "INVENTORY_ITEM_INFO")
public class InventoryItemInfo{
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "ID")
	private long id;
	
	@Column(name = "QUANTITY")
	private int quantity;
	
	@Column(name = "INVENTORY_ITEM_STATUS")
	private InventoryItemStatus status;
	
	@OneToMany(mappedBy="inventoryItemInfo", cascade=CascadeType.ALL)
	private Set<SalesOrderItem> orderItem = new HashSet<SalesOrderItem>();
	
	@ManyToOne(cascade={CascadeType.ALL})
    @JoinColumn(name="INVENTORY_STOCK_ID")
    private InventoryStock inventoryStock;
	
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	public InventoryItemStatus getStatus() {
		return status;
	}

	public void setStatus(InventoryItemStatus status) {
		this.status = status;
	}

	public Set<SalesOrderItem> getOrderItem() {
		return orderItem;
	}

	public void setOrderItem(Set<SalesOrderItem> orderItem) {
		this.orderItem = orderItem;
	}

	public InventoryStock getInventoryStock() {
		return inventoryStock;
	}

	public void setInventoryStock(InventoryStock inventoryStock) {
		this.inventoryStock = inventoryStock;
	}
}
